package com.test.daily.leetcode.y2021.m10.day1024;

import java.util.List;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2021/10/24 下午 08:32
 * @version: 1.0
 */
public class Code01_ShoppingOffer {

    public int shoppingOffers(List<Integer> price, List<List<Integer>> special, List<Integer> needs) {
        int status = 0;
        int finished = 1 << 7 - 1;
        int ans = 0;
        return process(price, special, needs, finished, ans, status);
    }

    public int process(List<Integer> price, List<List<Integer>> special, List<Integer> needs,  int finished, int ans,
     int status) {
        if (status == finished) {
            return ans;
        }
        for (int i = 0; i < special.size(); i++) {
            if(valid(needs, special.get(i))){
                ans = ans + special.get(i).get(special.get(i).size());
//                + process();
            }
        }
        return 0;
    }

    public boolean valid(List<Integer> need, List<Integer> specialMember){
        for(int i = 0; i < need.size(); i++){
            if(need.get(i) - specialMember.get(i) < 0){
                return false;
            }
        }
        return true;
    }
    public List<Integer> delete(List<Integer> need, List<Integer> specialMember,int status){
        for(int i = 0; i < need.size(); i++){
            int number = need.get(i) - specialMember.get(i);
            need.set(i, number);
            if(number == 0){

            }
        }
        return need;
    }
}
